package com.qunar.paydata.platform.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class UserEntity implements Serializable ,UserDetails{

    private static final long serialVersionUID = 1L;
    private int id;
    private String username;
    private String password;
//    private String role;
    
    

public Collection<? extends GrantedAuthority> getAuthorities() {
	String role = "ROLE_ADMIN";
    Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>();
    authorities.add(new SimpleGrantedAuthority(role));
    return authorities;

}
public UserEntity(String username, String password) {
	super();
	this.username = username;
	this.password = password;
}
public void setUsername(String username) {
	this.username = username;
}
public void setPassword(String password) {
	this.password = password;
}
public String getPassword() {
	// TODO Auto-generated method stub
	return this.password;
}
public String getUsername() {
	// TODO Auto-generated method stub
	return this.username;
}
public boolean isAccountNonExpired() {
	// TODO Auto-generated method stub
	return true;
}
public boolean isAccountNonLocked() {
	// TODO Auto-generated method stub
	return true;
}
public boolean isCredentialsNonExpired() {
	// TODO Auto-generated method stub
	return true;
}
public boolean isEnabled() {
	// TODO Auto-generated method stub
	return true;
}
}
